#include "HiranipraShared.h"

#include "HCM/IComponent.h"

#ifndef _SHARED_PLATFORM_IO_IFILESTREAM_H_
#define _SHARED_PLATFORM_IO_IFILESTREAM_H_

namespace Hiranipra {
	namespace Platform {
		namespace IO {

			class IFileStream : public RefInstance
			{
			public:
				virtual ~IFileStream(){}

				virtual int64 GetLength() const = 0;

				virtual void SetBuffer( const uint32 bufferSize ) = 0;
				virtual void Flush() = 0;
				virtual void Close() = 0;

				virtual int64 GetPosition() const = 0;
				virtual bool SetPosition( const int64 position ) = 0;
				virtual bool IsEOF() const = 0;

				virtual uint32 Read( void* buffer, uint32 size ) = 0;
				virtual uint32 Write( const void* buffer, uint32 size ) = 0;

				virtual uint32 Read( MemoryBuffer* buffer, uint32 toRead = 0xFFFFFFFF ) = 0;
				virtual uint32 Write( MemoryBuffer* buffer ) = 0;

				virtual bool ReadAll( MemoryBuffer& buffer ) = 0;
			};

		}
	}
}

#endif // _SHARED_PLATFORM_IO_IFILESTREAM_H_
